package com.group525.cloudef.controller.user;


import com.group525.cloudef.common.CommonResult;
import com.group525.cloudef.entity.user.UReport;
import com.group525.cloudef.service.user.UReportService;
import com.group525.cloudef.utils.Log;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author group525
 * @since 2023-05-23
 */
@RestController
@CrossOrigin
public class UReportController {
    @Resource
    Log log;

    @Resource
    UReportService uReportService;
    @RequestMapping("/report/getMyReports/{id}/{time}")
    public CommonResult<?> getMyReports(@PathVariable("id") String id, @PathVariable String time) {
        log.debug(" 用户ID ：", id);
        log.debug(" 查询时间 ：", time);
        return uReportService.getMyReports(id,time);
    }
    @RequestMapping("/report/getImageByReportNo/{id}")
    public CommonResult<?> getImageByReportNo(@PathVariable("id") String id) {
        log.debug(" 报告id ：", id);
        return uReportService.getImageByReportNo(id);
    }
    @RequestMapping("/admin/report/getAllReport")
    public List<UReport> getAllReport() {
        return uReportService.list();
    }


}

